package com.ebraga.trackerclub.android.util.api;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import com.ebraga.trackerclub.android.exception.BackofficeDBConnectionException;
import com.ebraga.trackerclub.android.exception.dao.BackofficeDaoException;
import com.ebraga.trackerclub.android.exception.dao.BackofficeIllegalArgumentDaoException;

public interface AndroidSQLiteDatabase {
	
	Cursor query(String table, String[] columns, String selection,
			String[] selectionArgs, String groupBy, String having,
			String orderBy) throws BackofficeIllegalArgumentDaoException, BackofficeDBConnectionException, BackofficeDaoException;

	Cursor query(String table, String[] columns, String selection,
			String[] selectionArgs, String groupBy, String having,
			String orderBy, String limit) throws BackofficeIllegalArgumentDaoException, BackofficeDBConnectionException, BackofficeDaoException;	
	
	Long insert(String table, AndroidContentValues values) throws BackofficeIllegalArgumentDaoException, BackofficeDBConnectionException, BackofficeDaoException;
	
	Long update(String table, AndroidContentValues values, String whereClause, String[] whereArgs) throws BackofficeIllegalArgumentDaoException, BackofficeDBConnectionException, BackofficeDaoException;
	
	int delete(String table, String whereClause, String[] whereArgs);
	
	public boolean isOpen();
	
	public void close();
	
	public Cursor rawQuery(String sql, String[] selectionArgs);
	
	public void setSQLLiteDataBase(SQLiteDatabase database);
	
	public void beginTransaction();
	
	public void endTransaction();
	
	public void setTransactionSuccessful();

}
